//
//  YYT_BaseViewController.m
//  AudioVisualFeast
//
//  Created by 温晓宇 on 16/1/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "QL_BaseViewController.h"
#import "AppDelegate.h"
#import "QL_DrawerViewController.h"
#import "QL_MySearchViewController.h"
@interface QL_BaseViewController ()

@end

@implementation QL_BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"首页";
    //    设置样式
    self.navigationController.navigationBar.barStyle = UIBarStyleBlack;
    //    导航栏元素样式
    self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
    //    首页左侧抽屉图片点击方法
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"Liebiaozuo"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]style:UIBarButtonItemStylePlain target:self action:@selector(left:)];
    //    首页右侧搜索图片点击方法
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithImage:[[UIImage imageNamed:@"Liebiaoyou"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]style:UIBarButtonItemStylePlain target:self action:@selector(right:)];
    
}
//搜索
- (void)right:(UIButton *)sender {
    NSLog(@"搜索");
    QL_MySearchViewController *searchVC = [[QL_MySearchViewController alloc]init];
    //隐藏tabbar
    searchVC.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:searchVC animated:YES];
    
}
//抽屉
- (void)left:(UIButton *)sender{
    AppDelegate *delegate = (AppDelegate*)[[UIApplication sharedApplication]delegate];
    QL_DrawerViewController *sideViewController = [delegate drawerViewController];
    [sideViewController showLeftViewController:true];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
